package cn.dapeng.designPatterns.proxy.cglib;

import net.sf.cglib.proxy.Enhancer;

/**
 * jdk17 与cglib 有冲突
 *  需要配置 vm启动参数 --add-opens java.base/java.lang=ALL-UNNAMED
 */
public class TestCase {

    public static void main(String[] args) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(Tank.class);
        enhancer.setCallback(new TimeMethodInterceptor());
        Tank tank = (Tank)enhancer.create();
        tank.move();
    }
}
